/**
* @author: zhanghuan
* @create: 2019/1/12
* @describe: 首页状态管理
*/
// initial state
// shape: [{ id, quantity }]
const state = {
  menu: {}
}

// getters
const getters = {
  getMenu: (state, getters, rootState) => {
    return state.menu;
  }
}

// actions
const actions = {
  setMenu ({ commit, state }, data) {
    commit('setMenuData', data);
  }
}

// mutations
const mutations = {
  setMenuData (state, data) {
    state.menu = data;
  }
}

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
